package phapp.model.barapp;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.apache.commons.lang.builder.ToStringBuilder;
import javacommon.base.BaseEntity;


/**
 * <p> 标题: 会员好友关系表, tc_vip_friend_info 数据类 POJO
 * <p>Description: DAO层映射到数据类,页面封装数据映射到数据类
 * <p>Copyright: Copyright (c) 2014-10
 * <p>Company: 
 * @author you name
 * @version 1.0
*/

public class VipFriend extends BaseEntity {
   
   //date formats
   public static final String FORMAT_CREATE_TIME = DATE_TIME_FORMAT;
   
   //columns START
   /**序列*/
   private java.lang.Integer id;
   /**主用户ID:增加者*/
   private java.lang.Integer mainId;
   /**被加者*/
   private java.lang.Integer passiveUserId;
   /**状态:1已经请求但未通过,2接受生效,3无效,如果删除好友,只是修改状态为3*/
   private java.lang.String statuss;
   /**创建时间*/
   private java.sql.Timestamp createTime;
   /**备注名*/
   private java.lang.String beizhuName;
   /**主用户:名*/
   private java.lang.String mainName;
   /**被加者：名*/
   private java.lang.String passiveUserName;
   
   private VipMain vipMain;
   
   private java.util.ArrayList idList;
   
   //columns END

	public VipFriend(){
	}

	public VipFriend(
		java.lang.Integer id
	){
		this.id = id;
	}

   public java.lang.String getBeizhuName() {
	   if(null==this.beizhuName||this.beizhuName.length()==0)
		   return "";
	   else
		   return this.beizhuName; 
	}

	public void setBeizhuName(java.lang.String beizhuName) {
		this.beizhuName = beizhuName;
	}
	
	public VipMain getVipMain() {
		return vipMain;
	}

	public void setVipMain(VipMain vipMain) {
		this.vipMain = vipMain;
	}

	public java.lang.String getMainName() {
		return mainName;
	}

	public void setMainName(java.lang.String mainName) {
		this.mainName = mainName;
	}

	public java.lang.String getPassiveUserName() {
		return passiveUserName;
	}

	public void setPassiveUserName(java.lang.String passiveUserName) {
		this.passiveUserName = passiveUserName;
	}

	public void setId(java.lang.Integer value) {
      this.id = value;
   }
   
   public java.lang.Integer getId() {
      return this.id;
   }
   public void setMainId(java.lang.Integer value) {
      this.mainId = value;
   }
   
   public java.lang.Integer getMainId() {
	   if(null==this.mainId||this.mainId.toString().length()==0)
		   return 0;
	   else
		   return this.mainId; 
   }
   public void setPassiveUserId(java.lang.Integer value) {
      this.passiveUserId = value;
   }
   
   public java.lang.Integer getPassiveUserId() {
	   if(null==this.passiveUserId||this.passiveUserId.toString().length()==0)
		   return 0;
	   else
		   return this.passiveUserId; 
   }
   public void setStatuss(java.lang.String value) {
      this.statuss = value;
   }
   
   public java.lang.String getStatuss() {
	   if(null==this.statuss||this.statuss.length()==0)
		   return "";
	   else
		   return this.statuss; 
   }
   public String getCreateTimeString() {
      return date2String(getCreateTime(), FORMAT_CREATE_TIME);
   }
   
   public void setCreateTimeString(String value) {
      setCreateTime(string2Date(value, FORMAT_CREATE_TIME,java.sql.Timestamp.class));
   }
   
   public void setCreateTime(java.sql.Timestamp value) {
      this.createTime = value;
   }
   
   public java.sql.Timestamp getCreateTime() {
      return this.createTime;
   }

   public java.util.ArrayList getIdList() {
      return idList;
   }

   public void setIdList(java.util.ArrayList idList) {
      this.idList = idList;
   }

    /**手动增加属性后,toString,hashCode,equals都要修改*/
   public String toString() {
      return new ToStringBuilder(this)
         .append("Id",getId())
         .append("MainId",getMainId())
         .append("PassiveUserId",getPassiveUserId())
         .append("Statuss",getStatuss())
         .append("CreateTime",getCreateTime())
         .append("BeizhuName",getBeizhuName())
         .toString();
   }
   
   public int hashCode() {
      return new HashCodeBuilder()
         .append(getId())
         .append(getMainId())
         .append(getPassiveUserId())
         .append(getStatuss())
         .append(getCreateTime())
         .append(getBeizhuName())
         .toHashCode();
   }
   
   public boolean equals(Object obj) {
      if(obj instanceof VipFriend == false) return false;
      if(this == obj) return true;
      VipFriend other = (VipFriend)obj;
      return new EqualsBuilder()
         .append(getId(),other.getId())
         .append(getMainId(),other.getMainId())
         .append(getPassiveUserId(),other.getPassiveUserId())
         .append(getStatuss(),other.getStatuss())
         .append(getCreateTime(),other.getCreateTime())
         .append(getBeizhuName(),other.getBeizhuName())
         .isEquals();
   }
}

